package com.service.impl;

import com.mapper.VehicleMapper;
import com.pojo.Vehicle;
import com.service.VehicleService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class VehicleServiceimpl implements VehicleService {
    @Resource
    private VehicleMapper vehicleMapper;
    @Override
    public int insertSelective(Vehicle record) {
        int i = vehicleMapper.insertSelective(record);
        return i;
    }
    @Override
    public List<Vehicle> selectVehicleByOwnerId(Integer ownerid) {
        List<Vehicle> vehicles = vehicleMapper.selectVehicleByOwnerid(ownerid);
        return vehicles;
    }

    @Override
    public Vehicle selectVehicleById(Integer id) {
        Vehicle vehicle = vehicleMapper.selectVehicleByid(id);
        return vehicle;
    }

    @Override
    public Vehicle selectVehicleBycarno(String carno) {
        Vehicle vehicle = vehicleMapper.selectVehicleBycarno(carno);
        return vehicle;
    }
}
